home *** CD-ROM | disk | FTP | other *** search
- /*
- File: MemHdr.h
-
- Contains: ODMemContainer header
-
- Owned by: Vincent Lo
-
- Copyright: © 1993 - 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 5/1/96 JA 1314704: Added fHandleSize. Removed zone
- stuff.
- <2> 6/20/94 CC ODMemoryHeap* changed to ODMemoryHeapID.
- <1> 5/27/94 VL first checked in
- To Do:
-
- In Progress:
-
- */
-
- #ifndef _MEMHDR_
- #define _MEMHDR_
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef _BENTOHDR_
- #include "BentoHdr.h"
- #endif
-
- #ifndef __CM_API__
- #include "CMAPI.h"
- #endif
-
- #ifndef __CM_API_TYPES__
- #include "CMAPITyp.h"
- #endif
-
- #ifndef _ODMEMORY_
- #include "ODMemory.h"
- #endif
-
- #ifndef _PLFMDEF_
- #include "PlfmDef.h"
- #endif
-
- //==============================================================================
- // Theory of Operation
- //==============================================================================
-
- //==============================================================================
- // Constants
- //==============================================================================
- extern const ODType kODBentoMemoryTypeName; // = "MemoryCtr";
-
- //==============================================================================
- // Scalar Types
- //==============================================================================
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
- class ODMemBentoHandlers;
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- //==============================================================================
- // ODMemBentoHandlers
- //==============================================================================
-
- class ODMemBentoHandlers : public ODBentoHandlers
- {
- public:
-
- ODMemBentoHandlers(CMSession session, ODHandle data);
- ODVMethod ~ODMemBentoHandlers();
-
- ODMethod void Initialize();
- ODMethod CMSession GetCMSession();
-
- ODMethod CMRefCon OpenHandler(CMOpenMode mode);
- ODMethod void CloseHandler();
- ODMethod CMSize FlushHandler();
- ODMethod CMSize SeekHandler(CM_LONG posOff, CMSeekMode mode);
- ODMethod CMSize TellHandler();
- ODMethod CMSize ReadHandler(CMPtr buffer, CMSize elementSize, CMCount theCount);
- ODMethod CMSize WriteHandler(CMPtr buffer, CMSize elementSize, CMCount theCount);
- ODMethod CMEofStatus EOFHandler();
- ODMethod CMBoolean TruncHandler(CMSize containerSize);
- ODMethod CMSize ContainerSizeHandler();
- ODMethod void ReadLabelHandler(CMMagicBytes magicByteSequence,
- CMContainerFlags *flags, CM_USHORT *bufSize,
- CM_USHORT *majorVersion, CM_USHORT *minorVersion,
- CMSize *tocOffset, CMSize *tocSize);
- ODMethod void WriteLabelHandler(CMMagicBytes magicByteSequence,
- CMContainerFlags flags, CM_USHORT bufSize,
- CM_USHORT majorVersion, CM_USHORT minorVersion,
- CMSize tocOffset, CMSize tocSize);
- ODMethod CMValue ReturnParentValueHandler();
- ODMethod CM_UCHAR* ReturnContainerNameHandler();
- ODMethod CMType ReturnTargetTypeHandler(CMContainer container);
- ODMethod void ExtractDataHandler(CMDataBuffer buffer,
- CMSize size, CMPrivateData data);
- ODMethod void FormatDataHandler(CMDataBuffer buffer,
- CMSize size,
- CMPrivateData data);
-
- private:
-
- CMSession fSession;
- ODHandle fData;
- ODBoolean fAllocated;
- CMSize fSize;
- CMSize fHandleSize;
- ODBoolean fSeekValid;
- ODULong fSeekPos;
- ODSLong fLastSeekOffset;
- ODSShort fLastSeekMode;
- ODBoolean fEOFReached;
- };
-
- #endif // _MEMHDR_